.PHONY: docker
docker:
	@docker rmi -f joil/webook:v0.0.1
	@docker build -t joil/webook:v0.0.1 -f Dockerfile ..

.PHONY: k8s
k8s:
	@kubectl apply -f k8s-mysql-pv.yaml
	@kubectl apply -f k8s-mysql-pvc.yaml
	@kubectl apply -f k8s-mysql-dep.yaml
	@kubectl apply -f k8s-mysql-svc.yaml
	@kubectl apply -f k8s-redis-dep.yaml
	@kubectl apply -f k8s-redis-svc.yaml
	@kubectl apply -f k8s-webook-dep.yaml
	@kubectl apply -f k8s-webook-svc.yaml

.PHONY: clean-k8s
clean-k8s:
	@kubectl delete service webook-mysql
	@kubectl delete deployment webook-mysql
	@kubectl delete pvc webook-mysql-pv-claim
	@kubectl delete pv webook-mysql-pv
	@kubectl delete service webook-redis
	@kubectl delete deployment webook-redis
	@kubectl delete service webook
	@kubectl delete deployment webook